package com.ate.aoligei.base;

import android.app.ProgressDialog;
import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

/**
 * @author Ate
 * @description:
 * @date :2020/11/9 15:53
 */
public abstract class BaseActivity extends AppCompatActivity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(getLayoutId());
        init();
    }

    public abstract int getLayoutId();

    protected void init(){

    }
    ProgressDialog dialog;
    protected void showProgress(){
         dialog = new ProgressDialog(this);
         dialog.setTitle("");
         dialog.setMax(100);
         dialog.show();
    }
    protected void dismissProgress(){
        if (dialog.isShowing()){
            dialog.dismiss();
        }
    }

}
